package org.example.yiyu.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.yiyu.model.Diary;
import org.example.yiyu.model.DiaryQuery;

import java.util.List;
import java.util.Map;

@Mapper
public interface DiaryMapper {

    //新增日记
    void insertDiary(Diary diary);
    //创建日记与标签关联
    void insertDiaryTag(Map<String, Object> params);
    //根据id删除日记
    void deleteDiary(Long id);
    //更新日记
    void updateDiary(Diary diary);
    //根据id查找日记
    Diary getDiaryById(Long id);
    //范围搜索日记
    List<Diary> findDiaries(DiaryQuery query);

}
